/**
 * Created by houjianhui on 2017/7/17.
 */

angular.module('kasApp', ['ionic', 'kas.controllers', 'kas.services'])
    // 配置
    .config(['$stateProvider', '$urlRouterProvider', '$httpProvider', '$ionicConfigProvider', function($stateProvider, $urlRouterProvider, $httpProvider, $ionicConfigProvider) {
        $stateProvider
            .state('tab', {
                url: '/tab',
                templateUrl: '../template/tabs.html'
            })
            .state('tab.orders', {
                url: '/orders',
                views: {
                    'tab-orders': {
                        templateUrl: '../template/tab/tab-orders.html',
                        controller: 'OrdersCtrl'
                    }
                }
            })
            .state('tab.myWaybill', {
                url: '/myWaybill',
                views: {
                    'my-waybill-view': {
                        templateUrl: '../template/tab/my-waybill-view.html',
                        controller: 'MyWaybillCtrl'
                    }
                }
            })
            .state('tab.mine', {
                url: '/mine',
                views: {
                    'tab-mine': {
                        templateUrl: '../template/tab/tab-mine.html',
                        controller: 'MineCtrl'
                    }
                }
            })
            .state('tab.bill', {
                url: '/bill',
                views: {
                    'tab-bill': {
                        templateUrl: '../template/tab/tab-bill.html',
                        controller: 'BillCtrl'
                    }
                }
            })
            .state('orders-detail', {
                url: '/orders-detail/{productName}',
                templateUrl: '../template/tab/order-detail.html',
                controller: 'OrderDetailCtrl'
            });
        $urlRouterProvider.otherwise('/tab');
    }]);